package com.punch.common.vo.user.menu;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

@Data
public class UserMenuTreeVO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 菜单id.
     */
    @ApiModelProperty(name = "menuId", notes = "菜单id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long menuId;

    /**
     * 父菜单id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long parentId;


    /**
     * 父菜单标题
     */
    @ApiModelProperty(name = "parentTitle", notes = "父菜单标题")
    private String parentTitle;

    /**
     * 路由名称.
     */
    @ApiModelProperty(name = "name", notes = "路由名称")
    private String name;

    /**
     * 路由path.
     */
    @ApiModelProperty(name = "path", notes = "路由path")
    private String path;

    /**
     * 文件路径
     */
    @TableField("component")
    private String component;

    /**
     * 图标
     */
    @TableField("meta")
    private JSONObject meta;

    /**
     * 所属应用0-PC,1-小程序
     */
    @TableField("application")
    private String application;


    /**
     * 排序.
     */
    @ApiModelProperty(name = "sort", notes = "排序")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Integer sort;


    /**
     * 菜单类型,0-目录,1-菜单,2-按钮
     */
    private Integer type;

    /**
     * 权限标识.
     */
    @ApiModelProperty(name = "perms", notes = "权限标识")
    private String perms;


    /**
     * 是否隐藏.
     */
    @ApiModelProperty(name = "hidden", notes = "是否隐藏")
    private boolean hidden;

//    /**
//     * 前端权限标识
//     */
//    @ApiModelProperty(name = "perms", notes = "前端权限标识")
//    private String frontPerms;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    private List<UserMenuTreeVO> children;

    /**
     * 前端菜单权限标识
     */
    @ApiModelProperty(name = "btnList", notes = "前端菜单权限标识")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private List<String> btnList;

}
